<?php


class UserController extends AdminAbstractController
{
    public function filters()
    {
        return array(
            'accessControl',
        );
    }

    public function accessRules()
    {
        return array(

        );
    }

    public function actionIndex()
    {

    }

    public function actionUpdate()
    {
        $model = Profile::model()->find(array(
            'condition' => 'userid=:userid',
            'params' => array('userid' => Yii::app()->user->id)
        ));

        if (isset($_POST['Profile']))
        {
            $model->attributes = $_POST['Profile'];
           // var_dump($_POST['Profile']);die;
            $model->setAttribute('skill_flag', 1);
          //  var_dump($model->attributes);die;
            if ($model->save())
            {
                $this->redirect(array('/admin/index'));
            }
            else
            {

            }
        }
        $this->render('update', array('model' => $model));
    }
}